]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/remote-access: Add menu for stopping screencasts
authorIvan Molodetskikh <yalterz@gmail.com>
Tue, 17 Aug 2021 07:58:23 +0000 (10:58 +0300)
committerMarge Bot <marge-bot@gnome.org>
Sat, 29 Jan 2022 14:43:49 +0000 (14:43 +0000)
This is specifically for stopping the screenshot UI screencasts for now.
It's possible to stop arbitrary screen recording handles, however due to
an issue with pipewiresrc, this method cannot currently work for cleanly
stopping Shell's own screen recordings. Hence the best we can do is to
handle just the screenshot UI screencasts to let them stop cleanly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>

js/ui/status/remoteAccess.js

index 21f6581b61707b7d62d76595dbbc6637d0fd2e61..d6d500caedc9afe1122840b4b2c5c03109cfed90 100644 (file)
@@ -3,6 +3,7 @@
 
 const { GObject, Meta } = imports.gi;
 
+const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 
@@ -50,6 +51,15 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
         this._recordingIndicator = this._addIndicator();
         this._recordingIndicator.icon_name = 'media-record-symbolic';
         this._recordingIndicator.add_style_class_name('screencast-indicator');
+
+        this._recordingItem = new PopupMenu.PopupSubMenuMenuItem(
+            _('Screen Recording in Progress'),
+            true
+        );
+        this._recordingItem.menu.addAction(_('Stop'),
+            () => Main.screenshotUI.stopScreencast());
+        this._recordingItem.icon.icon_name = 'media-record-symbolic';
+        this.menu.addMenuItem(this._recordingItem);
     }
 
     _isScreenShared() {
@@ -70,6 +80,7 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
         }
 
         this._recordingIndicator.visible = this._isRecording();
+        this._recordingItem.visible = Main.screenshotUI.screencast_in_progress;
     }
 
     _onStopped(handle) {